<!--外委---基桩检测信息---编辑 -->
<template>
  <div class="department">
    <!-- 右侧 -->
    <div class="department_right">
      <!-- 顶部导航栏 -->
      <div class="mechanism_nav">
        <!-- 左侧 -->
        <div class="mechanism_nav_left">
          <el-radio-group
            v-model="radio"
            size="small"
            @change="modelType($event)"
          >
            <el-radio-button label="待办"></el-radio-button>
            <el-radio-button label="已办"></el-radio-button>
            <!-- #2b5a9d -->
          </el-radio-group>
        </div>
        <!-- 顶部按钮 -->
        <div class="print">
          <div class="printTable">
            <el-button
              type="primary"
              icon="el-icon-refresh"
              size="small"
              @click="getDataList(getList)"
            ></el-button>

            <el-button
              type="primary"
              icon="el-icon-circle-plus-outline"
              size="small"
              v-if="getList.modelType == '0' && yj_add == true"
              @click="edit(0)"
              >新增</el-button
            >
            <el-button
              type="primary"
              icon="el-icon-edit"
              size="small"
              v-if="getList.modelType == '0' && yj_edit == true"
              @click="edit(1)"
              >编辑</el-button
            >
            <el-button
              type="primary"
              icon="el-icon-circle-check"
              size="small"
              v-if="getList.modelType == '0' && yj_submit == true"
              @click="SubmitText(fId)"
              >提交</el-button
            >
            <el-button
              type="primary"
              icon="el-icon-delete"
              size="small"
              v-if="getList.modelType == '0' && yj_delete == true"
              @click="rowDelete(fId)"
              >删除</el-button
            >
          </div>
        </div>
      </div>

      <!-- 表格 -->
      <div class="text_table">
        <el-table
          ref="multipleTable"
          v-loading="loading"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.2)"
          @row-click="getRowInfo($event, '0')"
          :data="tableData"
          style="width: 100%"
          height="100%"
          stripe
          border
          highlight-current-row
          @current-change="rowChange"
        >
          <el-table-column
            fixed
            type="index"
            label="序号"
            width="50"
            align="center"
          >
          </el-table-column>
          <el-table-column prop="F_ProjectName" label="项目名称">
            <!-- 超出鼠标滑过显示 -->
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.F_ProjectName">{{
                  scope.row.F_ProjectName
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="F_CompanyName" label="施工单位">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.F_CompanyName">{{
                  scope.row.F_CompanyName
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="F_EngineeringName" label="工程名称">
            <template slot-scope="scope">
              <el-button
                @click="openDialog('0', scope.row)"
                @cell-dblclick="openDialog"
                type="text"
                size="small"
                style="padding: 0 !important; margin: 0"
              >
                {{ scope.row.F_EngineeringName }}
              </el-button>
            </template>
          </el-table-column>

          <el-table-column
            prop="F_EngineeringLocation"
            label="工程地点"
            width="120"
            align="center"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a
                  href="javascript:;"
                  :title="scope.row.F_EngineeringLocation"
                  >{{ scope.row.F_EngineeringLocation }}</a
                >
              </div>
            </template>
          </el-table-column>

          <el-table-column
            prop="inspectionDates"
            label="报验日期"
            width="90"
            align="center"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.inspectionDates">{{
                  scope.row.inspectionDates
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="F_ContactsAndTel"
            label="联系人和电话"
            width="100"
            align="center"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.F_ContactsAndTel">{{
                  scope.row.F_ContactsAndTel
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="fFactoryname" label="检测项目" width="120">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.F_CheckContent">{{
                  scope.row.F_CheckContent
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="F_CheckerNames"
            label="检测人员"
            width="70"
            align="center"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.F_CheckerNames">{{
                  scope.row.F_CheckerNames
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="F_CheckFoundationCount"
            label="检测数量"
            width="70"
            align="center"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a
                  href="javascript:;"
                  :title="scope.row.F_CheckFoundationCount"
                  >{{ scope.row.F_CheckFoundationCount }}</a
                >
              </div>
            </template>
          </el-table-column>

          <el-table-column
            prop="FirstClasscount"
            label="I类"
            width="50"
            align="center"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.FirstClasscount">{{
                  scope.row.FirstClasscount
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="SecondClasscount"
            label="II类"
            width="50"
            align="center"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.SecondClasscount">{{
                  scope.row.SecondClasscount
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="ThirdClasscount"
            label="III类"
            width="50"
            align="center"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.ThirdClasscount">{{
                  scope.row.ThirdClasscount
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="FourthClasscount"
            label="IV类"
            width="50"
            align="center"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.FourthClasscount">{{
                  scope.row.FourthClasscount
                }}</a>
              </div>
            </template>
          </el-table-column>
          <!-- <el-table-column prop="fStatus" label="信息状态" width="100" align="center"> -->
          <el-table-column
            prop="F_Status"
            label="信息状态"
            width="70"
            align="center"
          >
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.F_Status">{{
                  scope.row.F_Status
                }}</a>
              </div>
            </template>
          </el-table-column>
          <template slot="empty">
            <img
              style="width: 285px; height: 208px"
              src="@/assets/img/undata.png"
              alt=""
            />
            <div class="pageFlagText">暂时没有数据哦！</div>
          </template>
        </el-table>
      </div>
      <!-- 按检测记录新增/编辑 -->
      <div class="Control-1 zj_ment">
        <el-dialog
          :title="dialogText"
          v-dialogDrag
          :visible.sync="dialogTableVisibleText"
          v-loading="loadingDialogText"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.2)"
        >
          <el-menu
            :default-active="activeIndex"
            class="el-menu-demo"
            mode="horizontal"
            @select="handleSelect"
          >
            <el-menu-item index="1">检测任务信息</el-menu-item>
            <el-menu-item index="2">基桩检测信息</el-menu-item>
          </el-menu>
          <!-- 检测任务信息 -->
          <div
            v-show="activeIndex == '1'"
            class="dialogBody common"
            :style="{ height: dialogHeight }"
          >
            <el-form :model="formData" :rules="rules" ref="formData">
              <div class="tableRow">
                <el-form-item
                  label="施工标段"
                  prop="fCompanyname"
                  :label-width="formLabelWidth"
                >
                  <el-input
                    v-model="formData.fCompanyname"
                    autocomplete="off"
                    placeholder="请选择"
                    :disabled="see"
                    @focus="getTree()"
                  ></el-input>
                </el-form-item>
                <el-form-item
                  label="工程名称"
                  prop="fProjectname"
                  :label-width="formLabelWidth"
                >
                  <el-select
                    v-model="formData.fProjectname"
                    placeholder="请选择"
                    @visible-change="Fproject(fCompanyid)"
                    :disabled="see"
                  >
                    <el-option
                      v-for="(v, i) in TestnoteData"
                      :key="i"
                      :label="v.fEngineeringname"
                      :value="v.fEngineeringname"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
              </div>
              <div class="tableRow">
                <el-form-item
                  label="检测项目"
                  prop="fCheckcontent"
                  :label-width="formLabelWidth"
                >
                  <el-select
                    v-model="formData.fCheckcontent"
                    placeholder="请选择"
                    @visible-change="function (Checkcontent) {
                        return getzd('Checkcontent');
                      }
                    "
                    :disabled="see"
                  >
                    <el-option
                      v-for="(v, i) in departmentList"
                      :key="i"
                      :label="v.fItemname"
                      :value="v.fItemname"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item
                  label="本次检测基桩数量"
                  prop="fCheckfoundationcount"
                  :label-width="formLabelWidth"
                >
                  <el-input
                    v-model="formData.fCheckfoundationcount"
                    autocomplete="off"
                    disabled
                    placeholder="自动填入"
                  >
                  </el-input>
                </el-form-item>
              </div>
              <div class="tableRow">
                <el-form-item
                  label="报验日期"
                  prop="fInspectiondates"
                  :label-width="formLabelWidth"
                >
                  <el-date-picker
                    v-model="formData.fInspectiondates"
                    type="date"
                    value-format="yyyy-MM-dd"
                    placeholder="选择日期"
                    autocomplete="off"
                    :disabled="see"
                  >
                  </el-date-picker>
                </el-form-item>
                <el-form-item
                  label="联系人和电话"
                  prop="fContactsandtel"
                  :label-width="formLabelWidth"
                >
                  <el-input
                    v-model="formData.fContactsandtel"
                    autocomplete="off"
                    :disabled="see"
                    placeholder="请输入"
                  >
                  </el-input>
                </el-form-item>
              </div>
              <div class="tableRow">
                <el-form-item
                  label="检测日期"
                  prop="fCheckdates"
                  :label-width="formLabelWidth"
                >
                  <el-date-picker
                    v-model="formData.fCheckdates"
                    type="date"
                    value-format="yyyy-MM-dd"
                    placeholder="选择日期"
                    autocomplete="off"
                    :disabled="see"
                  >
                  </el-date-picker>
                </el-form-item>
                <el-form-item
                  label="检测人员"
                  prop="fCheckernames"
                  :label-width="formLabelWidth"
                >
                  <el-input
                    v-model="formData.fCheckernames"
                    autocomplete="off"
                    :disabled="see"
                    placeholder="请选择"
                    @focus="personnel()"
                  ></el-input>
                </el-form-item>
              </div>

              <div class="tableRow">
                <el-form-item
                  label="是否为该工程最后一次检测"
                  prop="fIslastcheck"
                  :label-width="formLabelWidth"
                >
                  <el-select
                    v-model="formData.fIslastcheck"
                    placeholder="请选择"
                    :disabled="see"
                  >
                    <el-option
                      v-for="(v, i) in last"
                      :key="i"
                      :label="v"
                      :value="v"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>

                <el-form-item
                  label="资料附件"
                  :label-width="formLabelWidth"
                  class="enclosure"
                  style="height: 100%"
                >
                  <div
                    ref="fCheckfile"
                    style="
                      height: 25px;
                      line-height: 25px;
                      width: 100%;
                      display: flex;
                      border: 1px solid #d1d7e2;
                      border-radius: 5px;
                      margin: 8px 0 2px 0;
                    "
                  >
                    <div
                      v-for="(v, i) in fCheckfileList"
                      :key="i"
                      style="margin: 2px 3px; height: 87%"
                      @click="openPdfs(v)"
                    >
                      <img
                        style="max-width: 100%; max-height: 100%"
                        src="@/assets/img/pdf.png"
                      />
                    </div>
                  </div>
                  <el-button
                    v-if="!see"
                    type="primary"
                    icon="el-icon-search"
                    size="small"
                    @click="operation('0')"
                    style="margin: 8px 0 2px 3px"
                    >操作</el-button
                  >
                </el-form-item>
              </div>
            </el-form>
          </div>
          <!-- 基桩检测信息 -->
          <div
            v-show="activeIndex == '2'"
            class="dialogBody common reportSheet jzDialog"
            :style="{ height: dialogHeight }"
          >
            <el-table
              ref="multipleTableA"
              v-loading="loading"
              element-loading-text="拼命加载中"
              element-loading-spinner="el-icon-loading"
              element-loading-background="rgba(0, 0, 0, 0.2)"
              @row-click="getRowInfo($event, '1')"
              :data="formData.pierfoundationList"
              style="width: 100%"
              height="100%"
              stripe
              border
              highlight-current-row
              @current-change="rowChange"
            >
              <el-table-column fixed type="index" label="序号" align="center">
              </el-table-column>
              <el-table-column
                prop="fPiernumber"
                label="墩台桩号"
                align="center"
                width="70"
              >
                <template slot-scope="scope">
                  <!-- @click="openDialog('1', scope.row)" -->
                  <!-- <el-button @click="openDialog('1', scope.row)" @cell-dblclick="openDialog" type="text" size="small"
                    style="padding: 0 !important; margin: 0">
                    {{ scope.row.fPiernumber }}
                                            </el-button> -->
                  <div class="lineBoxhidden">
                    <a href="javascript:;" :title="scope.row.fPiernumber">{{
                      scope.row.fPiernumber
                    }}</a>
                  </div>
                </template>
              </el-table-column>
              <el-table-column
                prop="fPourdates"
                label="灌注日期"
                width="90"
                align="center"
              >
                <template slot-scope="scope">
                  <div class="lineBoxhidden">
                    <a href="javascript:;" :title="scope.row.fPourdates">{{
                      scope.row.fPourdates
                    }}</a>
                  </div>
                </template>
              </el-table-column>

              <el-table-column prop="fMethod" label="成孔方式" width="95">
                <template slot-scope="scope">
                  <div class="lineBoxhidden">
                    <a href="javascript:;" :title="scope.row.fMethod">{{
                      scope.row.fMethod
                    }}</a>
                  </div>
                </template>
              </el-table-column>

              <el-table-column
                prop="fStrengthgrade"
                label="强度等级"
                align="center"
                width="70"
              >
                <template slot-scope="scope">
                  <div class="lineBoxhidden">
                    <a href="javascript:;" :title="scope.row.fStrengthgrade">{{
                      scope.row.fStrengthgrade
                    }}</a>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="fPiertype" label="桩型" width="120">
                <template slot-scope="scope">
                  <div class="lineBoxhidden">
                    <a href="javascript:;" :title="scope.row.fPiertype">{{
                      scope.row.fPiertype
                    }}</a>
                  </div>
                </template>
              </el-table-column>
              <el-table-column
                prop="fCheckmethod"
                align="center"
                label="检测方法"
                width="110"
              >
                <template slot-scope="scope">
                  <div class="lineBoxhidden">
                    <a href="javascript:;" :title="scope.row.fCheckmethod">{{
                      scope.row.fCheckmethod
                    }}</a>
                  </div>
                </template>
              </el-table-column>
              <el-table-column
                prop="fPiercategory"
                label="桩类别"
                align="center"
                width="60"
              >
                <template slot-scope="scope">
                  <div class="lineBoxhidden">
                    <a href="javascript:;" :title="scope.row.fPiercategory">{{
                      scope.row.fPiercategory
                    }}</a>
                  </div>
                </template>
              </el-table-column>
              <el-table-column
                prop="fScenepicfile"
                label="现场照片"
                align="center"
                width="70"
              >
                <template slot-scope="scope">
                  <div
                    style="
                      display: flex;
                      height: 100%;
                      align-items: center;
                      flex-shrink: 0;
                    "
                  >
                    <div
                      v-for="(v, index) in scope.row.picsfiles"
                      :key="index"
                      style="
                        margin: 2px 3px;
                        display: flex;
                        flex-shrink: 0;
                        align-items: center;
                      "
                      v-viewer
                    >
                      <img
                        style="
                          max-width: 100%;
                          max-height: 100%;
                          width: 18px;
                          height: 20px;
                        "
                        :src="v.url"
                      />
                    </div>
                  </div>
                </template>
              </el-table-column>
              <el-table-column
                prop="fCheckfile"
                label="检测资料"
                align="center"
                width="70"
              >
                <template slot-scope="scope">
                  <div
                    style="
                      display: flex;
                      height: 100%;
                      align-items: center;
                      flex-shrink: 0;
                    "
                  >
                    <div
                      v-for="(v, index) in scope.row.checkfiles"
                      @click="openPdfs(v)"
                      :key="index"
                      style="
                        margin: 2px 3px;
                        display: flex;
                        flex-shrink: 0;
                        align-items: center;
                      "
                    >
                      <img
                        style="
                          max-width: 100%;
                          max-height: 100%;
                          width: 18px;
                          height: 20px;
                        "
                        src="@/assets/img/pdf.png"
                      />
                    </div>
                  </div>
                </template>
              </el-table-column>
              <el-table-column
                prop="fIsexception"
                label="是否异常"
                align="center"
                width="70"
              >
                <template slot-scope="scope">
                  <div class="lineBoxhidden">
                    <a href="javascript:;" :title="scope.row.fIsexception">{{
                      scope.row.fIsexception
                    }}</a>
                  </div>
                </template>
              </el-table-column>
              <el-table-column
                prop="fHandlerpicfile"
                label="处理照片"
                align="center"
                width="70"
              >
                <template slot-scope="scope">
                  <div
                    style="
                      display: flex;
                      height: 100%;
                      align-items: center;
                      flex-shrink: 0;
                    "
                  >
                    <div
                      v-for="(v, index) in scope.row.handlerfiles"
                      :key="index"
                      style="
                        margin: 2px 3px;
                        display: flex;
                        align-items: center;
                        flex-shrink: 0;
                      "
                      v-viewer
                    >
                      <img
                        style="
                          max-width: 100%;
                          max-height: 100%;
                          width: 18px;
                          height: 20px;
                        "
                        :src="v.url"
                      />
                    </div>
                  </div>
                </template>
              </el-table-column>
              <el-table-column
                prop="fExceptionfile"
                label="异常资料"
                align="center"
                width="70"
              >
                <template slot-scope="scope">
                  <div
                    style="
                      display: flex;
                      height: 100%;
                      align-items: center;
                      flex-shrink: 0;
                    "
                  >
                    <div
                      v-for="(v, index) in scope.row.exceptionfiles"
                      @click="openPdfs(v)"
                      :key="index"
                      style="
                        margin: 2px 3px;
                        display: flex;
                        align-items: center;
                        flex-shrink: 0;
                      "
                    >
                      <img
                        style="
                          max-width: 100%;
                          max-height: 100%;
                          width: 18px;
                          height: 20px;
                        "
                        src="@/assets/img/pdf.png"
                      />
                    </div>
                  </div>
                </template>
              </el-table-column>
              <el-table-column
                prop="fExceptioninfo"
                label="异常说明"
                align="center"
                width="77"
              >
                <template slot-scope="scope">
                  <div class="lineBoxhidden">
                    <a href="javascript:;" :title="scope.row.fExceptioninfo">{{
                      scope.row.fExceptioninfo
                    }}</a>
                  </div>
                </template>
              </el-table-column>
              <template slot="empty">
                <img
                  style="width: 285px; height: 208px"
                  src="@/assets/img/undata.png"
                  alt=""
                />
                <div class="pageFlagText">暂时没有数据哦！</div>
              </template>
            </el-table>
          </div>
          <div style="height: 40px">
            <div
              style="position: absolute; left: 15px; bottom: 0"
              v-show="activeIndex == '2'"
            >
              <button class="jzBtn" v-show="!see" @click="newList('0')">
                +
              </button>
              <button class="jzBtn" v-show="!see" @click="newList('1')">
                -
              </button>
            </div>
            <div style="position: absolute; right: 5px; bottom: 0">
              <el-button type="primary" v-show="!see" @click="submitForm()"
                >保存</el-button
              >
            </div>
          </div>
        </el-dialog>
      </div>
      <!-- 新增详情 -->
      <div class="Control-1 zj_new">
        <el-dialog
          :title="textTitle"
          v-dialogDrag
          :visible.sync="dialogTableVisible"
          v-loading="loadingDialog"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.2)"
        >
          <div
            class="dialogBody common jzDialog"
            :style="{ height: dialogHeightnew }"
          >
            <el-form
              :model="pierfoundationList"
              :rules="details ? srulea : srule"
              ref="pierfoundationList"
            >
              <div class="tableRow">
                <el-form-item
                  label="墩台桩号"
                  prop="fPiernumber"
                  :label-width="formLabelWidths"
                >
                  <el-input
                    v-model="pierfoundationList.fPiernumber"
                    autocomplete="off"
                    placeholder="请输入"
                    :disabled="see"
                  ></el-input>
                </el-form-item>
                <el-form-item
                  label="灌注日期"
                  prop="fPourdates"
                  :label-width="formLabelWidths"
                >
                  <el-date-picker
                    v-model="pierfoundationList.fPourdates"
                    type="date"
                    value-format="yyyy-MM-dd"
                    placeholder="选择日期"
                    autocomplete="off"
                    :disabled="see"
                  >
                  </el-date-picker>
                </el-form-item>
              </div>
              <div class="tableRow">
                <el-form-item
                  label="成孔方法"
                  prop="fMethod"
                  :label-width="formLabelWidths"
                >
                  <el-select
                    v-model="pierfoundationList.fMethod"
                    placeholder="请选择"
                    @visible-change="function (Method) {
                        return getzd('Method');
                      }
                    "
                    :disabled="see"
                  >
                    <el-option
                      v-for="(v, i) in hole"
                      :key="i"
                      :label="v.fItemname"
                      :value="v.fItemname"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item
                  label="强度等级"
                  prop="fStrengthgrade"
                  :label-width="formLabelWidths"
                >
                  <el-select
                    v-model="pierfoundationList.fStrengthgrade"
                    placeholder="请选择"
                    @visible-change="function (Strengthgrade) {
                        return getzd('Strengthgrade');
                      }
                    "
                    :disabled="see"
                  >
                    <el-option
                      v-for="(v, i) in strength"
                      :key="i"
                      :label="v.fItemname"
                      :value="v.fItemname"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
              </div>
              <div class="tableRow">
                <el-form-item
                  label="桩型"
                  prop="fPiertype"
                  :label-width="formLabelWidths"
                >
                  <el-select
                    v-model="pierfoundationList.fPiertype"
                    placeholder="请选择"
                    @visible-change="function (Piertype) {
                        return getzd('Piertype');
                      }
                    "
                    :disabled="see"
                  >
                    <el-option
                      v-for="(v, i) in pile"
                      :key="i"
                      :label="v.fItemname"
                      :value="v.fItemname"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item
                  label="检测方法"
                  prop="fCheckmethod"
                  :label-width="formLabelWidths"
                >
                  <el-select
                    v-model="pierfoundationList.fCheckmethod"
                    placeholder="请选择"
                    @visible-change="function (Checkmethod) {
                        return getzd('Checkmethod');
                      }
                    "
                    :disabled="see"
                  >
                    <el-option
                      v-for="(v, i) in testing"
                      :key="i"
                      :label="v.fItemname"
                      :value="v.fItemname"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
              </div>
              <div class="tableRow">
                <el-form-item
                  label="桩类别"
                  prop="fPiercategory"
                  :label-width="formLabelWidths"
                >
                  <el-select
                    v-model="pierfoundationList.fPiercategory"
                    placeholder="请选择"
                    @visible-change="function (Piercategory) {
                        return getzd('Piercategory');
                      }
                    "
                    :disabled="see"
                  >
                    <el-option
                      v-for="(v, i) in category"
                      :key="i"
                      :label="v.fItemname"
                      :value="v.fItemname"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item
                  label="现场照片"
                  :label-width="formLabelWidths"
                  class="enclosure"
                  style="height: 100%"
                >
                  <div
                    style="
                      height: 25px;
                      line-height: 25px;
                      width: 100%;
                      display: flex;
                      border: 1px solid #d1d7e2;
                      border-radius: 5px;
                      margin: 8px 0 2px 0;
                    "
                  >
                    <div
                      v-for="(v, i) in fScenepicfileList"
                      :key="i"
                      style="margin: 2px 3px; height: 87%"
                      v-viewer
                    >
                      <img
                        :src="v.url"
                        style="
                          max-width: 100%;
                          max-height: 100%;
                          width: 18px;
                          height: 20px;
                        "
                      />
                    </div>
                  </div>
                  <el-button
                    v-if="!see"
                    type="primary"
                    icon="el-icon-search"
                    size="small"
                    @click="operation('1')"
                    style="margin: 8px 0 2px 3px"
                    >操作</el-button
                  >
                </el-form-item>
              </div>

              <div class="tableRow">
                <el-form-item
                  label="检测资料"
                  prop="fCheckfile"
                  :label-width="formLabelWidths"
                  class="enclosure"
                  style="height: 100%"
                >
                  <div
                    style="
                      height: 25px;
                      line-height: 25px;
                      width: 100%;
                      display: flex;
                      border: 1px solid #d1d7e2;
                      border-radius: 5px;
                      margin: 8px 0 2px 0;
                    "
                  >
                    <div
                      v-for="(v, i) in fCheckfilesList"
                      :key="i"
                      style="margin: 2px 3px; height: 87%"
                      @click="openPdfs(v)"
                    >
                      <img
                        style="max-width: 100%; max-height: 100%"
                        src="@/assets/img/pdf.png"
                      />
                    </div>
                  </div>

                  <el-button
                    v-if="!see"
                    type="primary"
                    icon="el-icon-search"
                    size="small"
                    @click="operation('2')"
                    style="margin: 8px 0 2px 3px"
                    >操作</el-button
                  >
                </el-form-item>
                <el-form-item
                  label="是否异常"
                  prop="fIsexception"
                  :label-width="formLabelWidths"
                >
                  <el-select
                    v-model="pierfoundationList.fIsexception"
                    placeholder="请选择"
                    @change="abnormalY($event)"
                    :disabled="see"
                  >
                    <el-option
                      v-for="(v, i) in abnormal"
                      :key="i"
                      :label="v"
                      :value="v"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
              </div>
              <div class="tableRow" style="margin-top: 10px">
                <el-form-item
                  label="异常说明"
                  prop="fExceptioninfo"
                  :label-width="formLabelWidths"
                >
                  <el-input
                    v-model="pierfoundationList.fExceptioninfo"
                    placeholder="请输入内容"
                    autocomplete="off"
                    :disabled="details"
                    v-if="!see"
                  >
                  </el-input>
                  <el-input
                    v-model="pierfoundationList.fExceptioninfo"
                    placeholder="请输入内容"
                    autocomplete="off"
                    disabled
                    v-if="see"
                  >
                  </el-input>
                </el-form-item>
              </div>
              <div class="tableRow">
                <el-form-item
                  label="处理照片"
                  prop="fHandlerpicfile"
                  :label-width="formLabelWidths"
                  class="enclosure"
                  style="height: 100%"
                >
                  <el-input
                    v-if="false"
                    v-model="pierfoundationList.fHandlerpicfile"
                    autocomplete="off"
                  >
                  </el-input>
                  <div
                    style="
                      height: 25px;
                      line-height: 25px;
                      width: 100%;
                      display: flex;
                      border: 1px solid #d1d7e2;
                      border-radius: 5px;
                      margin: 8px 0 2px 0;
                    "
                  >
                    <div
                      v-for="(v, i) in fHandlerpicfileList"
                      :key="i"
                      style="margin: 2px 3px; height: 87%"
                      v-viewer
                    >
                      <img
                        :src="v.url"
                        style="
                          max-width: 100%;
                          max-height: 100%;
                          width: 18px;
                          height: 20px;
                        "
                      />
                    </div>
                    <!-- <div
                      v-for="(v, i) in fHandlerpicfileList"
                      :key="i"
                      style="margin: 2px 3px; height: 87%"
                      @click="openPdfs(v)"
                    >
                      <img
                        src="@/assets/img/enclosure/imgs.png"
                        alt=""
                        style="height: 90%"
                      /> 
                                                </div> -->
                  </div>
                  <el-button
                    type="primary"
                    icon="el-icon-search"
                    size="small"
                    @click="operation('3')"
                    style="margin: 8px 0 2px 3px"
                    v-if="!details"
                    >操作</el-button
                  >
                </el-form-item>
                <el-form-item
                  label="异常资料"
                  prop="fExceptionfile"
                  :label-width="formLabelWidths"
                  class="enclosure"
                  style="height: 100%"
                >
                  <el-input
                    v-if="false"
                    v-model="pierfoundationList.fExceptionfile"
                    autocomplete="off"
                  >
                  </el-input>
                  <div
                    style="
                      height: 25px;
                      line-height: 25px;
                      width: 100%;
                      display: flex;
                      border: 1px solid #d1d7e2;
                      border-radius: 5px;
                      margin: 8px 0 2px 0;
                    "
                  >
                    <div
                      v-for="(v, i) in fExceptionfileList"
                      :key="i"
                      style="margin: 2px 3px; height: 87%"
                      @click="openPdfs(v)"
                    >
                      <img
                        style="max-width: 100%; max-height: 100%"
                        src="@/assets/img/pdf.png"
                      />
                    </div>
                  </div>
                  <el-button
                    type="primary"
                    icon="el-icon-search"
                    size="small"
                    @click="operation('4')"
                    style="margin: 8px 0 2px 3px"
                    v-if="!details"
                    >操作</el-button
                  >
                </el-form-item>
              </div>
            </el-form>
          </div>
          <div style="height: 40px">
            <div style="position: absolute; right: 5px; bottom: 0">
              <el-button type="primary" v-show="!see" @click="submitForms(0)"
                >保存</el-button
              >
            </div>
          </div>
        </el-dialog>
      </div>
      <!-- 施工标段弹框 -->
      <div class="Control-1 zj_samll">
        <el-dialog
          title="选择施工标段"
          v-dialogDrag
          :visible.sync="dialogTableVisibleBd"
          v-loading="loadingDialogBd"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.2)"
        >
          <div class="dialogBody common" :style="{ height: dialogHeights }">
            <el-tree
              :data="treeData"
              :props="defaultProps"
              :highlight-current="highlightBd"
              @node-click="handleNodeClick"
              node-key="fCompanyid"
              :accordion="true"
              :expand-on-click-node="false"
            >
            </el-tree>

            <div>
              <div style="position: absolute; right: 5px; bottom: 0">
                <el-button type="primary" @click="submitForms(1)"
                  >保存</el-button
                >
              </div>
            </div>
          </div>
        </el-dialog>
      </div>
      <!-- 上传附件  -->
      <!-- 资料附件 -->
      <div class="Control-1 mechanism_dialog enclosure">
        <el-dialog
          :title="titleText"
          v-dialogDrag
          :visible.sync="dialogTableVisibleTexts"
          v-loading="loadingDialogTexts"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.2)"
        >
          <div class="dialogBody common" :style="{ height: dialogHeights }">
            <el-upload
              action="action"
              ref="upload"
              list-type="picture-card"
              :auto-upload="false"
              :file-list="fCheckfileList"
              :on-change="handleChange"
              accept=".pdf"
            >
              <i slot="default" class="el-icon-plus"></i>
              <div
                style="width: 100%; height: 100%; text-align: center"
                slot="file"
                slot-scope="{ file }"
              >
                <div
                  style="
                    width: 100%;
                    height: 100%;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                  "
                  class="images"
                >
                  <img
                    style="max-width: 100%; max-height: 100%"
                    src="@/assets/img/pdf.png"
                  />
                </div>
                <span class="el-upload-list__item-actions">
                  <span
                    title="文件预览"
                    class="el-upload-list__item-preview"
                    @click="openPdf(file)"
                  >
                    <i class="el-icon-zoom-in"></i>
                  </span>
                  <span
                    title="删除文件"
                    class="el-upload-list__item-delete"
                    @click="handleRemove(file)"
                  >
                    <i class="el-icon-delete"></i>
                  </span>
                </span>
              </div>
            </el-upload>
            <div>
              <div style="position: absolute; right: 5px; bottom: 0">
                <el-button type="primary" @click="submitUpload(enclosureImg)"
                  >保存</el-button
                >
              </div>
            </div>
          </div>
        </el-dialog>
      </div>
      <!-- 检测资料 -->
      <div class="Control-1 mechanism_dialog enclosure">
        <el-dialog
          :title="titleText"
          v-dialogDrag
          :visible.sync="dialogTableVisibleTexts2"
          v-loading="loadingDialogTexts"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.2)"
        >
          <div class="dialogBody common" :style="{ height: dialogHeights }">
            <el-upload
              action="action"
              ref="upload"
              list-type="picture-card"
              :auto-upload="false"
              :file-list="fCheckfilesList"
              :on-change="handleChange"
              accept=".pdf"
            >
              <i slot="default" class="el-icon-plus"></i>
              <div
                style="width: 100%; height: 100%; text-align: center"
                slot="file"
                slot-scope="{ file }"
              >
                <div
                  style="
                    width: 100%;
                    height: 100%;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                  "
                  class="images"
                >
                  <img
                    style="max-width: 100%; max-height: 100%"
                    src="@/assets/img/pdf.png"
                  />
                </div>
                <span class="el-upload-list__item-actions">
                  <span
                    title="文件预览"
                    class="el-upload-list__item-preview"
                    @click="openPdf(file)"
                  >
                    <i class="el-icon-zoom-in"></i>
                  </span>
                  <span
                    title="删除文件"
                    class="el-upload-list__item-delete"
                    @click="handleRemove(file)"
                  >
                    <i class="el-icon-delete"></i>
                  </span>
                </span>
              </div>
            </el-upload>
            <div>
              <div style="position: absolute; right: 5px; bottom: 0">
                <el-button type="primary" @click="submitUpload(enclosureImg2)"
                  >保存</el-button
                >
              </div>
            </div>
          </div>
        </el-dialog>
      </div>
      <!-- 异常资料 -->
      <div class="Control-1 mechanism_dialog enclosure">
        <el-dialog
          :title="titleText"
          v-dialogDrag
          :visible.sync="dialogTableVisibleTexts4"
          v-loading="loadingDialogTexts"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.2)"
        >
          <div class="dialogBody common" :style="{ height: dialogHeights }">
            <el-upload
              action="action"
              ref="upload"
              list-type="picture-card"
              :auto-upload="false"
              :file-list="fExceptionfileList"
              :on-change="handleChange"
              accept=".pdf"
            >
              <i slot="default" class="el-icon-plus"></i>
              <div
                style="width: 100%; height: 100%; text-align: center"
                slot="file"
                slot-scope="{ file }"
              >
                <div
                  style="
                    width: 100%;
                    height: 100%;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                  "
                  class="images"
                >
                  <img
                    style="max-width: 100%; max-height: 100%"
                    src="@/assets/img/pdf.png"
                  />
                </div>
                <span class="el-upload-list__item-actions">
                  <span
                    title="文件预览"
                    class="el-upload-list__item-preview"
                    @click="openPdf(file)"
                  >
                    <i class="el-icon-zoom-in"></i>
                  </span>
                  <span
                    title="删除文件"
                    class="el-upload-list__item-delete"
                    @click="handleRemove(file)"
                  >
                    <i class="el-icon-delete"></i>
                  </span>
                </span>
              </div>
            </el-upload>
            <div>
              <div style="position: absolute; right: 5px; bottom: 0">
                <el-button type="primary" @click="submitUpload(enclosureImg4)"
                  >保存</el-button
                >
              </div>
            </div>
          </div>
        </el-dialog>
      </div>
      <!-- 现场照片  -->
      <div class="Control-1 mechanism_dialog enclosure">
        <el-dialog
          :title="titleText"
          v-dialogDrag
          :visible.sync="dialogTableVisibleImg1"
          v-loading="loadingDialogImg"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.2)"
        >
          <div class="dialogBody common" :style="{ height: dialogHeights }">
            <el-upload
              action="action"
              ref="uploadImg"
              list-type="picture-card"
              :auto-upload="false"
              :file-list="fScenepicfileList"
              :on-change="handleChange"
              accept=".jpg, .jpeg, .png, .gif, .bmp, .JPG, .JPEG, .PBG, .GIF, .BMP"
            >
              <i slot="default" class="el-icon-plus"></i>
              <div
                style="width: 100%; height: 100%; text-align: center"
                slot="file"
                slot-scope="{ file }"
              >
                <div
                  style="
                    width: 100%;
                    height: 100%;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                  "
                  class="images"
                  v-viewer
                >
                  <img
                    style="max-width: 100%; max-height: 100%"
                    :src="file.url"
                  />
                </div>
                <span class="el-upload-list__item-actions">
                  <span
                    title="图片预览"
                    class="el-upload-list__item-preview"
                    @click="handlePictureCardPreview(file)"
                  >
                    <i class="el-icon-zoom-in"></i>
                  </span>
                  <span
                    title="删除图片"
                    class="el-upload-list__item-delete"
                    @click="handleRemove(file)"
                  >
                    <i class="el-icon-delete"></i>
                  </span>
                </span>
              </div>
            </el-upload>
            <div>
              <div style="position: absolute; right: 5px; bottom: 0">
                <el-button type="primary" @click="submitUpload(enclosureImg1)"
                  >保存</el-button
                >
              </div>
            </div>
          </div>
        </el-dialog>
      </div>
      <!-- 处理照片  -->
      <div class="Control-1 mechanism_dialog enclosure">
        <el-dialog
          :title="titleText"
          v-dialogDrag
          :visible.sync="dialogTableVisibleImg3"
          v-loading="loadingDialogImg"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.2)"
        >
          <div class="dialogBody common" :style="{ height: dialogHeights }">
            <el-upload
              action="action"
              ref="uploadImg"
              list-type="picture-card"
              :auto-upload="false"
              :file-list="fHandlerpicfileList"
              :on-change="handleChange"
              accept=".jpg, .jpeg, .png, .gif, .bmp, .JPG, .JPEG, .PBG, .GIF, .BMP"
            >
              <i slot="default" class="el-icon-plus"></i>
              <div
                style="width: 100%; height: 100%; text-align: center"
                slot="file"
                slot-scope="{ file }"
              >
                <div
                  style="
                    width: 100%;
                    height: 100%;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                  "
                  class="images"
                  v-viewer
                >
                  <img
                    style="max-width: 100%; max-height: 100%"
                    :src="file.url"
                  />
                </div>
                <span class="el-upload-list__item-actions">
                  <span
                    title="图片预览"
                    class="el-upload-list__item-preview"
                    @click="handlePictureCardPreview(file)"
                  >
                    <i class="el-icon-zoom-in"></i>
                  </span>
                  <span
                    title="删除图片"
                    class="el-upload-list__item-delete"
                    @click="handleRemove(file)"
                  >
                    <i class="el-icon-delete"></i>
                  </span>
                </span>
              </div>
            </el-upload>
            <div>
              <div style="position: absolute; right: 5px; bottom: 0">
                <el-button type="primary" @click="submitUpload(enclosureImg3)"
                  >保存</el-button
                >
              </div>
            </div>
          </div>
        </el-dialog>
      </div>
      <!-- 附件展示 -->
      <div class="Control-2">
        <el-dialog
          top="4vh"
          :title="fFileName"
          v-dialogDrag
          :visible.sync="dialogPdf"
        >
          <div :style="{ height: dialogHeighta }">
            <iframe
              :src="pdfUrl"
              width="100%"
              height="100%"
              frameborder="0"
            ></iframe>
          </div>
        </el-dialog>
      </div>

      <!-- 成员 -->
      <div class="Control-1 MemberCommon mechanism_dialog">
        <el-dialog
          :close-on-click-modal="false"
          title="人员选择"
          v-dialogDrag
          :visible.sync="memberVisible"
          v-loading="loadingMemberDialog"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.2)"
        >
          <div
            class="dialogBody member"
            :style="{ height: MemberDialogHeight }"
          >
            <!-- 添加成员 -->
            <div class="MemberDialogBox">
              <div class="addMemberCheckBox">
                <div class="addMemberCheckTree">
                  <div class="companyBox">
                    <el-tree
                      :data="companyInfo"
                      :props="defaultPropa"
                      @node-click="selectCompany"
                      :highlight-current="highlightBds"
                    ></el-tree>
                  </div>
                  <div class="departmentBox">
                    <div
                      class="departmentTitle"
                      v-for="(item, index) in departmentLists"
                      :key="index"
                      @click="seletDepartment(item, index)"
                    >
                      <a
                        href="javascript:;"
                        :class="num === item.fDepartmentId ? 'activetext' : ''"
                        :title="item.fShortName"
                      >
                        {{ item.fShortName }}</a
                      >
                    </div>
                  </div>
                </div>

                <div class="addMemberCheckLeft">
                  <el-checkbox-group
                    v-model="checkboxGroup1"
                    @change="selectRealname($event, personList)"
                  >
                    <el-checkbox-button
                      v-for="item in personList"
                      :label="item.fUserid"
                      :key="item.fUserid"
                      :value="item.fRealname"
                    >
                      <div class="addMemberCheck">
                        <div class="MemberIcon">
                          <!--  -->
                          <!-- -->
                          <img :src="item.fGender == 0 ? girls : boys" alt="" />
                        </div>
                        <div class="MemberDetailInfos">
                          <div class="name">{{ item.fRealname }}</div>
                          <div class="hostName">{{ item.fDepartmentName }}</div>
                          <div class="hostName">{{ item.fAccount }}</div>
                        </div>
                      </div>
                    </el-checkbox-button>
                  </el-checkbox-group>
                </div>
                <div class="selectPerson">
                  <div class="selectPersonTitle">
                    已选人员（{{ newData.length }}人）
                  </div>
                  <div class="selectPersonData">
                    <div
                      class="selectPersonDataBox"
                      v-for="item in newData"
                      :label="item.fRealname"
                      :key="item.fRealname"
                    >
                      <div class="MemberIcon">
                        <img :src="item.fGender == 0 ? girls : boys" alt="" />
                      </div>
                      <div class="MemberDetailInfo1">
                        <div class="name">{{ item.fRealname }}</div>
                        <div class="hostName">{{ item.fDepartmentName }}</div>
                        <div class="hostName">{{ item.fAccount }}</div>
                      </div>
                      <div
                        class="deleteUser"
                        @click="deteleUser(item.fUserid)"
                      ></div>
                    </div>
                  </div>
                </div>
              </div>

              <div class="newlyAdded_btns">
                <el-button type="primary" @click="submitMember()"
                  >保存</el-button
                >
                <el-button type="warning" @click="memberVisible = false"
                  >关闭</el-button
                >
              </div>
            </div>
          </div>
        </el-dialog>
      </div>
    </div>
  </div>
</template>

<script>
import {
  getPierTaskPageList,
  getPierTaskByFid,
  addPierTask,
  deletePierTaskByFid,
  submitPierTask,
  upload, //上传文件
  getPierProjectListByCompanyId,
  getBaseDataitemDetailByItemCode,
  getUserCompanyTreeList,
  getBaseCompanyList,
  getBaseDepartmentUser,
} from "@/api/request.js";
export default {
  inject: ["reload"],
  name: "Home",
  data() {
    return {
      // 按钮
      name: "MonitoringText",
      yj_add: null,
      yj_edit: null,
      yj_delete: null,
      yj_submit: null,
      // 按钮
      formLabelWidth: "160px", //弹框文字部分宽度
      formLabelWidths: "60px", //弹框文字部分宽度
      activeIndex: "1",
      TestnoteData: [], //工程名称
      departmentList: [], //检测项目
      last: ["是", "否"], //是否为最后一次

      // 施工标段弹框--机构树
      dialogTableVisibleBd: false,
      loadingDialogBd: false,
      treeData: [],
      defaultProps: {
        children: "children",
        label: "fShortname",
      },
      highlightBd: true, //机构树停留背景色
      treeText: {
        companyId: null,
        userId: null,
      },
      treeString: null,
      fCompanyid: "", //查看工程名称参数
      // 资料附件
      fCheckfileList: [],
      timestamp: null,
      attachmentDetails: [],
      //资料附件
      // 现场照片
      fScenepicfileList: [],
      timestamp1: null,
      attachmentDetails1: [],
      // 现场照片
      // 检测资料
      fCheckfilesList: [],
      timestamp2: null,
      attachmentDetails2: [],
      // 检测资料
      // 处理照片
      fHandlerpicfileList: [],
      timestamp3: null,
      attachmentDetails3: [],
      // 处理照片
      // 异常资料
      fExceptionfileList: [],
      timestamp4: null,
      attachmentDetails4: [],
      // 异常资料
      see: false,
      dialogTableVisibleTexts: false,
      dialogTableVisibleImg1: false,
      dialogTableVisibleTexts2: false,
      dialogTableVisibleImg3: false,
      dialogTableVisibleTexts4: false,
      loadingDialogTexts: false,
      enclosureImg: {},
      enclosureImg1: {},
      enclosureImg2: {},
      enclosureImg3: {},
      enclosureImg4: {},
      titleText: "", //附件弹框显示名

      imgsFId: {
        fId: null, //文件id
      },
      imgsRemoveList: null,
      recordfilesList: [],
      dialogHeights: "240px",
      operationNum: null, //判断当前操作那个文件传输框
      // 附件展示
      dialogPdf: false,
      pdfUrl: "",
      fFileName: "",
      dialogHeighta: "",
      // 附件展示

      // 上传图片
      loadingDialogImg: false,
      dialogTableVisibleImg: false,
      // 上传图片

      // 上传附件

      // 弹框

      // 列表
      radio: "待办",
      getList: {
        modelType: "0", // 0待办 1已办  2查询页面
        fCompanyid: "", //机构id
        fUserid: "", //当前登录用户id
        sublevel: "", //查看下级  1是0否
        page: 1, //页码
        pageSize: 20, //每页条数
      },
      tableData: [], //列表数据
      loading: false,
      // 列表

      // 新增/编辑
      dialogText: "",
      dialogTableVisibleText: false,
      loadingDialogText: false,
      formData: {
        // 任务表信息
        fId: "", // 检测任务信息表fid  有值时为修改  其余为新增
        fCompanyid: "", // 施工标段（单位）id  当前登录人
        fCompanyname: "", // 施工标段（单位）名称  当前登录人
        fProjectid: "", // 工程id   当前登录人
        fProjectname: "", // 工程名称  当前登录人
        fCheckcontent: "", // 检测项目
        fCheckfoundationcount: "", // 本次检测基桩数量
        fInspectiondates: "", // 报验日期
        fContactsandtel: "", //联系人和电话
        fCheckdates: "", // 检测日期
        memberList: [],
        fCheckerids: "", // 检测人员ids（字符串拼接","隔开）
        fCheckernames: "", // 检测人员names（字符串拼接","隔开）
        fIslastcheck: "", // 是否最后一次检测 0-否  1-是
        fCheckfile: "", // 本次检测附件资料id
        // 子表信息
        pierfoundationList: [],
        // 当前用户信息
        userId: "", // 当前用户id
        userName: "", // 当前用户名称
        recordfiles: [
          {
            //删除文件id集合--修改时传
            fId: "", //文件id
          },
        ],
      },
      rules: {
        fCompanyname: [{ required: true, message: "请选择", trigger: "blur" }],
        fProjectname: [{ required: true, message: "请选择", trigger: "blur" }],
        fCheckcontent: [{ required: true, message: "请选择", trigger: "blur" }],
        fCheckfoundationcount: [
          { required: true, message: "请选择", trigger: "blur" },
        ],
        fInspectiondates: [
          { required: true, message: "请选择", trigger: "blur" },
        ],
        fContactsandtel: [
          { required: true, message: "请选择", trigger: "blur" },
        ],
        fCheckdates: [{ required: true, message: "请选择", trigger: "blur" }],
        fCheckernames: [{ required: true, message: "请选择", trigger: "blur" }],
        fIslastcheck: [{ required: true, message: "请选择", trigger: "blur" }],
      },
      //详情
      loadingDialog: false,
      dialogTableVisible: false,
      textTitle: "", //详情弹框标题
      pierfoundationList: {
        fPiernumber: "", // 桩台编号
        fPourdates: "", // 灌注日期
        fMethod: "", // 成孔方法
        fStrengthgrade: "", // 强度等级
        fPiertype: "", // 桩型
        fCheckmethod: "", // 检测方法
        fPiercategory: "", // 桩类别
        fScenepicfile: "", // 现场照片id
        fCheckfile: "", // 检测资料id
        fIsexception: "", // 是否异常
        fExceptioninfo: "", // 异常说明
        fHandlerpicfile: "", // 处理照片id
        fExceptionfile: "", // 异常资料id
        picsfiles: [], // 现场照片
        handlerfiles: [], // 处理照片
        checkfiles: [], // 检测资料
        exceptionfiles: [], // 异常资料
        // picsfiles
      },
      srule: {
        fPiernumber: [{ required: true, message: "请选择", trigger: "blur" }],
        fPourdates: [{ required: true, message: "请选择", trigger: "blur" }],
        fMethod: [{ required: true, message: "请选择", trigger: "blur" }],
        fStrengthgrade: [
          { required: true, message: "请选择", trigger: "blur" },
        ],
        fPiertype: [{ required: true, message: "请选择", trigger: "blur" }],
        fCheckmethod: [{ required: true, message: "请选择", trigger: "blur" }],
        fPiercategory: [{ required: true, message: "请选择", trigger: "blur" }],
        fIsexception: [{ required: true, message: "请选择", trigger: "blur" }],
        fExceptioninfo: [
          { required: true, message: "请选择", trigger: "blur" },
        ],
      },
      srulea: {
        fPiernumber: [{ required: true, message: "请选择", trigger: "blur" }],
        fPourdates: [{ required: true, message: "请选择", trigger: "blur" }],
        fMethod: [{ required: true, message: "请选择", trigger: "blur" }],
        fStrengthgrade: [
          { required: true, message: "请选择", trigger: "blur" },
        ],
        fPiertype: [{ required: true, message: "请选择", trigger: "blur" }],
        fCheckmethod: [{ required: true, message: "请选择", trigger: "blur" }],
        fPiercategory: [{ required: true, message: "请选择", trigger: "blur" }],
        fIsexception: [{ required: true, message: "请选择", trigger: "blur" }],
      },
      details: false, //根据是否异常判断必填项
      fPiernumber: "", //详情点击当前行墩台桩号
      category: [], // 类别
      // abnormal: ["是", "否"], //是否异常
      abnormal: ["有", "无"], //是否异常
      hole: [], //成孔方法
      strength: [], //强度等级
      pile: [], //桩型
      testing: [], //检测方法
      // 详情
      // 新增/编辑

      dialogHeight: "",
      dialogHeightnew: "",

      fId: null, //当前数据fId
      userInfo: {}, //登录用户
      row: null, //当前行信息

      // 人员弹框
      loadingMemberDialog: false,
      memberVisible: false,
      MemberDialogHeight: "",
      companyInfo: [], //公司树信息
      defaultPropa: {
        children: "children",
        label: "fShortname",
      },
      highlightBds: true,
      departmentLists: [], //部门
      companyTreeData: [], //公司
      personList: [], //人员列表新增
      checkboxGroup1: [],
      newData: [],
      allUserInfo: [],
      boys: require("@/assets/img/organization/boys.png"),
      girls: require("@/assets/img/organization/girls.png"),
      num: null,
      // 人员弹框
    };
  },
  created() {
    this.userInfo = JSON.parse(sessionStorage.getItem("yjSmart-userInfo"));
    this.getList.fUserid = this.userInfo.userId;
    this.getList.fCompanyid = this.userInfo.companyId;
  },
  mounted() {
    // 获取页面高度
    this.getHeight();
    // 列表
    this.getDataList(this.getList);
    // 按钮权限
    this.btnRole(this.name);
  },
  methods: {
    // 按钮权限
    btnRole(name) {
      var btnList = [];
      var ModuleList = JSON.parse(sessionStorage.getItem("yjSmart-ModuleList"));
      if (ModuleList.length > 0) {
        ModuleList.map((item) => {
          if (item.fEncode == name) {
            btnList = item.modulebuttonList;
          }
        });
        var btnStr = [];
        btnList.map((item) => {
          btnStr.push(item.fEncode);
        });
        this.yj_add = btnStr.includes("yj_add");
        this.yj_edit = btnStr.includes("yj_edit");
        this.yj_delete = btnStr.includes("yj_delete");
        this.yj_submit = btnStr.includes("yj_submit");
      } else {
        this.yj_add = true;
        this.yj_edit = true;
        this.yj_delete = true;
        this.yj_submit = true;
      }
    },

    // 机构树
    // 获取机构树
    getTree() {
      this.treeText.companyId = this.userInfo.companyId;
      this.treeText.userId = this.userInfo.userId;
      this.loadingDialogBd = true;
      getUserCompanyTreeList(this.treeText)
        .then((res) => {
          if (res.errcode == 0) {
            this.loadingDialogBd = false;
            this.dialogTableVisibleBd = true;
            var companyTree = res.data.userCompanyTreeList;
            this.treeData = this.tranListToTreeData(companyTree);
          } else {
            this.$message.error("机构树", res.msg);

            return false;
          }
        })
        .catch(() => {
          console.log("机构树接口报错");
          return false;
        });
    },
    // 遍历树状图
    tranListToTreeData(data) {
      let result = [];
      if (!Array.isArray(data)) {
        return result;
      }
      // 清除已存在的children 重新赋值
      data.forEach((item) => {
        delete item.children;
      });

      let map = {};
      data.forEach((item) => {
        map[item.fCompanyid] = item;
      });

      data.forEach((item) => {
        let parent = map[item.fParentid];
        if (parent) {
          (parent.children || (parent.children = [])).push(item);
        } else {
          result.push(item);
        }
      });
      return result;
    },
    // 点击左侧机构树
    handleNodeClick(data) {
      this.treeString = data;
    },
    // 机构树

    // 工程名称
    // 施工标段获取工程列表接口
    Fproject(id) {
      getPierProjectListByCompanyId({
        fCompanyid: id,
      })
        .then((res) => {
          if (res.errcode == 0) {
            this.TestnoteData = res.data; //工程列表
          } else {
            this.$message.error("工程名称", res.msg);
            return false;
          }
        })
        .catch((error) => {
          console.log("工程名称", error);
          return false;
        });

      for (let index = 0; index < this.TestnoteData.length; index++) {
        const element = this.TestnoteData[index];
        if (this.formData.fProjectname == element.fEngineeringname) {
          this.formData.fProjectid = element.fId;
        }
      }
    },
    // 工程名称

    // 人员选择
    // 选择公司
    selectCompany(e) {
      this.getBaseDepartmentUser(e.fCompanyid);
    },
    // 部门管理-查询部门列表以及下属人员
    getBaseDepartmentUser(id) {
      getBaseDepartmentUser({ fCompanyid: id })
        .then((res) => {
          if (res.errcode == 0) {
            this.departmentLists = res.data.childList;
          } else {
            this.$message.error(res.msg);
            console.log("部门管理-查询部门列表以及下属人员,接口报错");
          }
        })
        .catch((error) => {
          console.log("部门管理-查询部门列表以及下属人员", error);
        });
    },

    // 选择部门
    seletDepartment(e) {
      this.num = e.fDepartmentId;
      this.personList = [];

      let obj = {};
      // let reduce = [];
      this.personList = e.personList.reduce(function (item, next) {
        //item为没有重复id的数组，next为当前对象
        obj[next.fUserid] ? "" : (obj[next.fUserid] = true && item.push(next));
        return item;
      }, []);
    },

    // 删除用户
    deteleUser(id) {
      this.newData = this.newData.filter((item) => {
        return item.fUserid != id;
      });
      this.checkboxGroup1 = this.checkboxGroup1.filter((item) => {
        return item != id;
      });
    },

    // 选择人员头像
    selectRealname(e, data) {
      this.allUserInfo = this.allUserInfo.concat(data);
      let obj = {};
      let reduce = [];
      reduce = this.allUserInfo.reduce((item, next) => {
        //item为没有重复id的数组，next为当前对象
        obj[next.fUserid] ? "" : (obj[next.fUserid] = true && item.push(next));
        return item;
      }, []); //所在部门所有人员
      this.newData = [];
      reduce.map((item) => {
        this.checkboxGroup1.map((i) => {
          if (item.fUserid == i) {
            this.newData.push(item); //所有选中的
          }
        });
      });
      this.formData.memberList = this.newData;
    },
    // 获取树
    getBaseCompanyList() {
      getBaseCompanyList({})
        .then((res) => {
          if (res.errcode == 0) {
            this.companyTreeData = res.data.baseCompanyList;
            this.companyInfo = this.tranListToTreeData(
              res.data.baseCompanyList
            );
          } else {
            this.$message.error("获取组织机构单位,接口报错", res.msg);
          }
        })
        .catch((error) => {
          console.log("获取组织机构单位", error);
        });
    },

    // 选人点击事件
    personnel() {
      this.getBaseCompanyList();
      this.departmentLists = [];
      this.personList = [];
      this.checkboxGroup1 = [];
      this.memberVisible = true;
      this.newData = this.formData.memberList;

      this.allUserInfo = this.allUserInfo.concat(this.formData.memberList);
      this.newData.map((item) => {
        this.checkboxGroup1.push(item.fUserid);
      });
      this.loadingMemberDialog = false;
    },

    // 保存
    submitMember() {
      this.memberVisible = false;
      var arr1 = [];
      var arr2 = [];
      this.newData.map((item) => {
        arr1.push(item.fRealname);
        arr2.push(item.fUserid);
      });
      this.formData.fCheckernames = arr1.join(",");
      this.formData.fCheckerids = arr2.join(",");
    },

    // 人员选择

    // 上传附件
    // 操作按钮
    operation(num) {
      this.operationNum = num;
      if (num == "0") {
        this.titleText = "上传附件";
        this.dialogTableVisibleTexts = true;
      } else if (num == "1") {
        this.titleText = "上传照片";
        this.dialogTableVisibleImg1 = true;
      } else if (num == "2") {
        this.titleText = "上传附件";
        this.dialogTableVisibleTexts2 = true;
      } else if (num == "3") {
        this.titleText = "上传照片";
        this.dialogTableVisibleImg3 = true;
      } else if (num == "4") {
        this.titleText = "上传附件";
        this.dialogTableVisibleTexts4 = true;
      }
    },
    // 上传照片
    handleChange(res) {
      if (this.operationNum == "0") {
        this.attachmentDetails.push(res);
        this.enclosureImg = new FormData(); //new一个formData事件
        this.enclosureImg.append("file", res.raw); //将file属性添加到formData里
        this.enclosureImg.append("folderid", this.timestamp); //将file属性添加到formData里
        this.enclosureImg.append("userId", this.userInfo.userId); //将file属性添加到formData里
        this.enclosureImg.append("userName", this.userInfo.realName); //将file属性添加到formData里
        upload(this.enclosureImg).then((i) => {
          i[0]["name"] = res.name;
          i[0]["url"] = res.url;
          this.fCheckfileList.push(i[0]); //资料附件
        });
      } else if (this.operationNum == "1") {
        this.attachmentDetails1.push(res);
        this.enclosureImg1 = new FormData();
        this.enclosureImg1.append("file", res.raw);
        this.enclosureImg1.append("folderid", this.timestamp1);
        this.enclosureImg1.append("userId", this.userInfo.userId);
        this.enclosureImg1.append("userName", this.userInfo.realName);
        upload(this.enclosureImg1).then((i) => {
          i[0]["name"] = res.name;
          i[0]["url"] = res.url;
          this.fScenepicfileList.push(i[0]); //现场照片

          //   this.fScenepicfileList = row.picsfiles; // 现场照片
          // this.fHandlerpicfileList = row.handlerfiles; // 处理照片
          // this.fCheckfilesList = row.checkfiles; // 检测资料
          // this.fExceptionfileList = row.exceptionfiles; // 异常资料
        });
      } else if (this.operationNum == "2") {
        this.attachmentDetails2.push(res);
        this.enclosureImg2 = new FormData();
        this.enclosureImg2.append("file", res.raw);
        this.enclosureImg2.append("folderid", this.timestamp2);
        this.enclosureImg2.append("userId", this.userInfo.userId);
        this.enclosureImg2.append("userName", this.userInfo.realName);
        upload(this.enclosureImg2).then((i) => {
          i[0]["name"] = res.name;
          i[0]["url"] = res.url;
          this.fCheckfilesList.push(i[0]); //检测资料
        });
      } else if (this.operationNum == "3") {
        this.attachmentDetails3.push(res);
        this.enclosureImg3 = new FormData();
        this.enclosureImg3.append("file", res.raw);
        this.enclosureImg3.append("folderid", this.timestamp3);
        this.enclosureImg3.append("userId", this.userInfo.userId);
        this.enclosureImg3.append("userName", this.userInfo.realName);
        upload(this.enclosureImg3).then((i) => {
          i[0]["name"] = res.name;
          i[0]["url"] = res.url;
          this.fHandlerpicfileList.push(i[0]); //处理照片
        });
      } else if (this.operationNum == "4") {
        this.attachmentDetails4.push(res);
        this.enclosureImg4 = new FormData();
        this.enclosureImg4.append("file", res.raw);
        this.enclosureImg4.append("folderid", this.timestamp4);
        this.enclosureImg4.append("userId", this.userInfo.userId);
        this.enclosureImg4.append("userName", this.userInfo.realName);
        upload(this.enclosureImg4).then((i) => {
          i[0]["name"] = res.name;
          i[0]["url"] = res.url;
          this.fExceptionfileList.push(i[0]); //异常资料
        });
      }
    },
    // 保存上传图片
    submitUpload() {
      this.dialogTableVisibleTexts = false;
      this.dialogTableVisibleImg1 = false;
      this.dialogTableVisibleImg3 = false;
      this.dialogTableVisibleTexts2 = false;
      this.dialogTableVisibleTexts4 = false;
    },
    // 预览
    openPdf(file) {
      this.dialogPdf = true;
      this.pdfUrl = file.url;
      this.fFileName = file.fFileName;
    },
    // 图片预览
    handlePictureCardPreview(file) {
      for (let i = 0; i < this.$el.querySelectorAll(".images").length; i++) {
        if (
          file.url ===
          this.$el.querySelectorAll(".images")[i].getElementsByTagName("img")[0]
            .src
        ) {
          const viewer = this.$el.querySelectorAll(".images")[i].$viewer;
          viewer.show();
          break;
        }
      }
    },
    // 移除
    handleRemove(file) {
      if (this.operationNum == "0") {
        // 资料附件
        this.$refs.upload.handleRemove(file);
        for (let index = 0; index < this.fCheckfileList.length; index++) {
          if (file.url == this.fCheckfileList[index].url) {
            if (this.fCheckfileList[index].atta == undefined) {
              this.formData.recordfiles.push({
                fId: this.fCheckfileList[index].fId,
              });
            } else {
              this.formData.recordfiles.push({
                fId: this.fCheckfileList[index].atta.fId,
              });
            }
            this.fCheckfileList.splice(index, 1);
          }
        }
      } else if (this.operationNum == "1") {
        // 现场照片
        this.$refs.uploadImg.handleRemove(file);
        for (let index = 0; index < this.fScenepicfileList.length; index++) {
          if (file.url == this.fScenepicfileList[index].url) {
            if (this.fScenepicfileList[index].atta == undefined) {
              this.formData.recordfiles.push({
                fId: this.fScenepicfileList[index].fId,
              });
            } else {
              this.formData.recordfiles.push({
                fId: this.fScenepicfileList[index].atta.fId,
              });
            }
            this.fScenepicfileList.splice(index, 1);
          }
        }
      } else if (this.operationNum == "2") {
        // 检测资料
        this.$refs.upload.handleRemove(file);
        for (let index = 0; index < this.fCheckfilesList.length; index++) {
          if (file.url == this.fCheckfilesList[index].url) {
            if (this.fCheckfilesList[index].atta == undefined) {
              this.formData.recordfiles.push({
                fId: this.fCheckfilesList[index].fId,
              });
            } else {
              this.formData.recordfiles.push({
                fId: this.fCheckfilesList[index].atta.fId,
              });
            }
            this.fCheckfilesList.splice(index, 1);
          }
        }
      } else if (this.operationNum == "3") {
        // 处理照片
        this.$refs.uploadImg.handleRemove(file);
        for (let index = 0; index < this.fHandlerpicfileList.length; index++) {
          if (file.url == this.fHandlerpicfileList[index].url) {
            if (this.fHandlerpicfileList[index].atta == undefined) {
              this.formData.recordfiles.push({
                fId: this.fHandlerpicfileList[index].fId,
              });
            } else {
              this.formData.recordfiles.push({
                fId: this.fHandlerpicfileList[index].atta.fId,
              });
            }
            this.fHandlerpicfileList.splice(index, 1);
          }
        }
      } else if (this.operationNum == "4") {
        // 异常资料
        this.$refs.upload.handleRemove(file);
        for (let index = 0; index < this.fExceptionfileList.length; index++) {
          if (file.url == this.fExceptionfileList[index].url) {
            if (this.fExceptionfileList[index].atta == undefined) {
              this.formData.recordfiles.push({
                fId: this.fExceptionfileList[index].fId,
              });
            } else {
              this.formData.recordfiles.push({
                fId: this.fExceptionfileList[index].atta.fId,
              });
            }
            this.fExceptionfileList.splice(index, 1);
          }
        }
      }
    },
    // 展示文件
    openPdfs(v) {
      this.dialogPdf = true;
      this.pdfUrl = v.url;
      this.fFileName = v.fFileName;
    },

    // 上传附件

    // 待办/已办
    modelType(e) {
      this.row = "";
      this.fId = "";
      if (e == "待办") {
        this.getList.modelType = "0";
      } else {
        this.getList.modelType = "1";
      }
      this.getDataList(this.getList);
    },
    // 获取列表数据
    getDataList(id) {
      this.loading = true;
      getPierTaskPageList(id)
        .then((res) => {
          if (res.errcode == 0) {
            var that = this;
            that.loading = false;
            that.tableData = res.data.pageInfo.list;
            setTimeout(() => {
              that.$nextTick(() => {
                that.$refs.multipleTable.doLayout();
              });
            }, 200);
          } else {
            this.$message.error("获取列表数据", res.msg);
            this.loading = false;
            return false;
          }
        })
        .catch((error) => {
          console.log("获取列表数据接口报错", error);
          this.loading = false;
        });
    },

    // 新增/编辑
    edit(num) {
      this.activeIndex = "1";
      this.see = false;

      this.formData = {
        // 任务表信息
        fId: "", // 检测任务信息表fid  有值时为修改  其余为新增
        fCompanyid: "", // 施工标段（单位）id  当前登录人
        fCompanyname: "", // 施工标段（单位）名称  当前登录人
        fProjectid: "", // 工程id   当前登录人
        fProjectname: "", // 工程名称  当前登录人
        fCheckcontent: "", // 检测项目
        fCheckfoundationcount: "", // 本次检测基桩数量
        fInspectiondates: "", // 报验日期
        fContactsandtel: "", //联系人和电话
        fCheckdates: "", // 检测日期
        fCheckerids: "", // 检测人员ids（字符串拼接","隔开）
        memberList: [],
        fCheckernames: "", // 检测人员names（字符串拼接","隔开）
        fIslastcheck: "否", // 是否最后一次检测 0-否  1-是
        fCheckfile: "", // 本次检测附件资料id
        // 子表信息
        pierfoundationList: [],
        // 当前用户信息
        userId: "", // 当前用户id
        userName: "", // 当前用户名称
        recordfiles: [
          //删除文件id集合--修改时传
        ],
      };

      if (num == 0) {
        if (this.userInfo.companyId != "") {
          // 新增
          this.getDate();
          // 附件资料
          this.attachmentDetails = [];
          this.fCheckfileList = [];
          this.timestamp = "ZLFJ" + Date.parse(new Date()); //资料附件
          this.formData.fCheckfile = this.timestamp;
          // 附件资料

          // this.formData.fCompanyid = this.userInfo.companyId;
          // this.formData.fCompanyname = this.userInfo.companyName;
          this.formData.userId = this.userInfo.userId;
          this.formData.userName = this.userInfo.realName;

          this.dialogText = "新增";
          this.dialogTableVisibleText = true;
        } else {
          this.$message.error("该用户无法新增数据");
        }
      } else {
        // 编辑
        if (this.fId != null && this.fId != "") {
          this.dialogText = "编辑";
          this.loadingDialogText = true;
          getPierTaskByFid({ fId: this.fId })
            .then((res) => {
              if (res.errcode == 0) {
                var that = this;
                that.loadingDialogText = false;
                that.dialogTableVisibleText = true;
                that.formData = res.data.lrCheckPiertask;
                if (that.formData.fIslastcheck == "0") {
                  that.formData.fIslastcheck = "否";
                  this.details = true;
                } else {
                  that.formData.fIslastcheck = "是";
                  this.details = false;
                }
                that.timestamp = res.data.lrCheckPiertask.fCheckfile;
                that.fCheckfileList = res.data.checkFile;
                that.formData.recordfiles = [];
              } else {
                this.$message.error("编辑", res.msg);
                this.loadingDialogText = false;
              }
            })
            .catch(() => {
              console.log("详情接口报错");
              this.loadingDialogText = false;
            });
        } else {
          return this.$message.error("请先选择需要编辑的数据");
        }
      }
    },
    // 弹框内+/-按钮
    newList(num) {
      this.pierfoundationList = {
        fid: "", //唯一标识
        fPiernumber: "", // 桩台编号
        fPourdates: "", // 灌注日期
        fMethod: "", // 成孔方法
        fStrengthgrade: "", // 强度等级
        fPiertype: "", // 桩型
        fCheckmethod: "", // 检测方法
        fPiercategory: "", // 桩类别
        fScenepicfile: "", // 现场照片id
        fCheckfile: "", // 检测资料id
        fIsexception: "无", // 是否异常
        fExceptioninfo: "", // 异常说明
        fHandlerpicfile: "", // 处理照片id
        fExceptionfile: "", // 异常资料id
        picsfiles: [
          // 现场照片
          // {
          //     "fId": "wu_1dis77ggt1nqk96e14p6pvd1tgma", // 文件fid
          //     "filePath": "/fileAnnexes/9c14p6pvd1tgma.jpg", // 文件地址
          //     "fFileName": "资料证书.jpg", // 文件名称
          //     "fFileType": "jpg" // 文件格式
          // }
        ],
        handlerfiles: [
          // 处理照片
          // {}
        ],
        checkfiles: [
          // 检测资料
          // {}
        ],
        exceptionfiles: [
          // 异常资料
          // {}
        ],
      };
      if (num == "0") {
        // 新增
        this.getDate();
        this.textTitle = "新增基桩检测";
        this.dialogTableVisible = true;
        // 现场照片
        this.attachmentDetails1 = [];
        this.fScenepicfileList = [];
        this.timestamp1 = "XCZP" + Date.parse(new Date());
        this.pierfoundationList.fScenepicfile = this.timestamp1;
        // 现场照片

        // 检测资料
        this.attachmentDetails2 = [];
        this.fCheckfilesList = [];
        this.timestamp2 = "JCZL" + Date.parse(new Date());
        this.pierfoundationList.fCheckfile = this.timestamp2;
        // 检测资料

        // 处理照片
        this.attachmentDetails3 = [];
        this.fHandlerpicfileList = [];
        this.timestamp3 = "CLZP" + Date.parse(new Date());
        this.pierfoundationList.fHandlerpicfile = this.timestamp3;
        // 处理照片

        // 异常资料
        this.attachmentDetails4 = [];
        this.fExceptionfileList = [];
        this.timestamp4 = "YCZL" + Date.parse(new Date());
        this.pierfoundationList.fExceptionfile = this.timestamp4;
        // 异常资料

        this.pierfoundationList.fid = "ZJ" + Date.parse(new Date()); //唯一标识
        if (this.pierfoundationList.fIsexception == "无") {
          this.details = true;
        }
      } else {
        // 删除
        if (this.formData.pierfoundationList.length > 0) {
          if (this.fPiernumber != "") {
            for (
              let index = 0;
              index < this.formData.pierfoundationList.length;
              index++
            ) {
              const element = this.formData.pierfoundationList[index];
              if (this.fPiernumber == element.fId) {
                this.formData.pierfoundationList.splice(index, 1);
              }
            }
            this.formData.fCheckfoundationcount =
              this.formData.pierfoundationList.length.toString();
          } else {
            return this.$message.error("请先选择需要刪除的数据");
          }
        } else {
          return this.$message.error("当前无可删除数据");
        }
      }
    },
    abnormalY(e) {
      if (e == "有") {
        this.details = false;
      } else {
        this.details = true;
      }
    },
    // 保存
    submitForm(formName) {
      if (this.formData.fIslastcheck == "否") {
        this.formData.fIslastcheck = "0";
      } else if (this.formData.fIslastcheck == "是") {
        this.formData.fIslastcheck = "1";
      }

      this.$refs.formData.validate((valid) => {
        if (valid) {
          addPierTask(this.formData)
            .then((res) => {
              if (res.errcode == 0) {
                this.dialogTableVisibleText = false;
                this.getDataList(this.getList);
                this.$message.success("保存成功");
                this.$refs[formName].resetFields();
              } else {
                this.$message.error("保存失败", res.msg);
              }
            })
            .catch(() => {
              console.log("保存接口出错");
            });
        } else {
          this.$message.error("请填写必填项");
          return false;
        }
      });
    },
    // 详情保存
    submitForms(num) {
      if (num == 0) {
        this.$refs.pierfoundationList.validate((valid) => {
          if (valid) {
            // this.fScenepicfileList; //现场照片
            // this.fScenepicfileList = row.picsfiles;
            this.pierfoundationList.picsfiles = this.fScenepicfileList; // 现场照片
            this.pierfoundationList.checkfiles = this.fCheckfilesList; //检测资料
            this.pierfoundationList.exceptionfiles = this.fExceptionfileList; // 异常资料
            this.pierfoundationList.handlerfiles = this.fHandlerpicfileList; //处理照片

            this.formData.pierfoundationList.push(this.pierfoundationList);
            this.formData.pierfoundationList;
            this.dialogTableVisible = false;
            this.$message.success("新增成功");
            this.formData.fCheckfoundationcount =
              this.formData.pierfoundationList.length.toString();
          } else {
            this.$message.error("请填写必填项");
            return false;
          }
        });
      } else if (num == 1) {
        this.fCompanyid = this.treeString.fCompanyid;
        this.formData.fCompanyname = this.treeString.fShortname;
        this.formData.fCompanyid = this.treeString.fCompanyid;
        this.dialogTableVisibleBd = false;
      }
    },
    // 提交
    SubmitText(id) {
      if (id != "" && id != null) {
        this.$confirm("是否继续提交?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.loading = true;
            submitPierTask({
              fId: id,
            })
              .then((res) => {
                if (res.errcode == 0) {
                  this.loading = false;
                  this.reload();
                  this.$message.success("提交成功");
                } else {
                  this.$message.error("提交失败", res.msg);
                  this.loading = false;
                  return false;
                }
              })
              .catch(() => {
                console.log("提交接口报错");
                this.loading = false;
              });
          })
          .catch(() => {
            this.$message("取消提交");
          });
      } else {
        return this.$message.error("请先选择需要提交的数据");
      }
    },
    // 删除
    rowDelete(id) {
      if (id != "" && id != null) {
        this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.loading = true;
            deletePierTaskByFid({ fId: id })
              .then((res) => {
                if (res.errcode == 0) {
                  this.loading = false;
                  this.reload();
                  this.$message.success("删除成功");
                } else {
                  this.$message.error("删除失败", res.msg);
                  this.loading = false;
                  return false;
                }
              })
              .catch(() => {
                this.loading = false;
                this.$message.error("删除接口调取失败");
              });
          })
          .catch(() => {
            this.$message("取消删除");
          });
      } else {
        return this.$message.error("请先选择需要删除的数据");
      }
    },

    // 点击当前行
    getRowInfo(e, num) {
      this.fId = "";
      this.row = "";
      if (num == "0") {
        // 列表页当前行
        this.row = e;
        this.fId = e.F_Id;
      } else {
        //弹框内当前行
        this.row = e;
        this.fPiernumber = e.fId;
      }
    },
    // 点击工程名称
    openDialog(num, row) {
      this.see = true;
      if (num == "0") {
        this.fId = row.F_Id;
        this.editText();
      } else {
        this.textTitle = "查看基桩检测";
        this.dialogTableVisible = true;
        this.pierfoundationList = row;
        this.fScenepicfileList = row.picsfiles; // 现场照片
        this.fHandlerpicfileList = row.handlerfiles; // 处理照片
        this.fCheckfilesList = row.checkfiles; // 检测资料
        this.fExceptionfileList = row.exceptionfiles; // 异常资料
      }
    },
    // 查看
    editText() {
      this.activeIndex = "1";
      if (this.fId != null && this.fId != "") {
        this.dialogText = "查看";
        this.loadingDialogText = true;
        getPierTaskByFid({ fId: this.fId })
          .then((res) => {
            if (res.errcode == 0) {
              var that = this;
              that.loadingDialogText = false;
              that.dialogTableVisibleText = true;
              that.formData = res.data.lrCheckPiertask;
              if (that.formData.fIslastcheck == "0") {
                that.formData.fIslastcheck = "否";
              } else {
                that.formData.fIslastcheck = "是";
              }
              that.timestamp = res.data.lrCheckPiertask.fCheckfile;
              that.fCheckfileList = res.data.checkFile;
              that.formData.recordfiles = [];
            } else {
              this.$message.error("查看", res.msg);
              this.loadingDialogText = false;
            }
          })
          .catch(() => {
            console.log("详情接口报错");
            this.loadingDialogText = false;
          });
      } else {
        return this.$message.error("请先选择需要查看的数据");
      }
    },
    // 点击当前行变色
    rowChange(val) {
      this.currentRow = val;
    },
    //点击弹框内侧标题
    handleSelect(key) {
      this.activeIndex = key;
    },
    // 获取页面容器高度
    getHeight() {
      var h = document.documentElement.clientHeight; //获取页面可见高度
      // var w = document.documentElement.clientWidth; //获取页面可见高度
      this.dialogHeight = h * 0.35 + "px";
      this.dialogHeightnew = h * 0.3 + "px";

      this.dialogHeighta = h * 0.9 + "px";
      // 成员Dialog高度
      this.MemberDialogHeight = h * 0.66 + "px";
    },
    // 获取当前日期
    getDate() {
      var time = new Date();
      const y = time.getFullYear();

      var m = time.getMonth() + 1 + "";
      m = (m < 10 ? "0" : "") + m;

      var d = time.getDate() + "";
      d = (d < 10 ? "0" : "") + d;

      this.formData.fInspectiondates = `${y}-${m}-${d}`;
      this.formData.fCheckdates = `${y}-${m}-${d}`;
      this.pierfoundationList.fPourdates = `${y}-${m}-${d}`;
    },
    // 获取字典项
    getzd(id) {
      getBaseDataitemDetailByItemCode({
        fItemcode: id,
      })
        .then((res) => {
          if (id == "Method") {
            // 成孔方式
            this.hole = res.data.baseDataitemdetailList;
          } else if (id == "Strengthgrade") {
            // 强度等级
            this.strength = res.data.baseDataitemdetailList;
          } else if (id == "Piertype") {
            // 桩型
            this.pile = res.data.baseDataitemdetailList;
          } else if (id == "Checkmethod") {
            // 检测方法
            this.testing = res.data.baseDataitemdetailList;
          } else if (id == "Piercategory") {
            // 桩类别
            this.category = res.data.baseDataitemdetailList;
          } else if (id == "Checkcontent") {
            //检测项目
            this.departmentList = res.data.baseDataitemdetailList;
          }
        })
        .catch((error) => {
          console.log("获取字典项", error);
        });
    },
  },
};
</script>

<style scoped lang="less">
.MemberDialogBox {
  width: 100%;
  height: 100%;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;

  .selectMember {
    width: 180px;
  }

  .selectMemberBox {
    height: 40px;
    width: 100%;
    display: flex;
    padding-bottom: 5px;

    .selectMemberLeft {
      width: 30%;
      box-sizing: border-box;
    }

    .selectMemberRight {
      display: flex;
      align-items: center;
      width: 52%;
      // padding: 0 0 0 20px;
    }
  }
}

a {
  text-decoration: none;
  color: #000;
}

.addMemberCheckBox {
  width: 100%;
  height: 93%;
  display: flex;

  .addMemberCheckTree {
    width: 30%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(221, 221, 221, 1);
    box-sizing: border-box;

    .companyBox {
      height: 70%;
      box-sizing: border-box;
    }

    .departmentBox {
      height: 30%;
      border-top: 0.5px solid rgba(221, 221, 221, 1);
      /* border: 1px solid red; */
      display: flex;
      flex-wrap: wrap;
      align-content: flex-start;
      overflow: hidden;
      overflow-y: auto;

      .departmentTitle {
        width: 77px;
        text-align: center;
        height: 40px;
        margin: 5px;
        // border: 1px solid green;
        border-radius: 8px;
        background: #d4daea;
        overflow: hidden;

        a {
          width: 100%;
          height: 100%;
          display: block;
          text-decoration: none;
        }
      }
    }
  }

  .selectMemberLeft {
    display: flex;
    align-items: center;
  }

  .addMemberCheckLeft {
    width: 52%;
    padding: 0 0 0 20px;
    border-top: 1px solid rgba(221, 221, 221, 1);
    border-bottom: 1px solid rgba(221, 221, 221, 1);
    border-right: 1px solid rgba(221, 221, 221, 1);

    .addMemberCheck {
      width: 150px;
      height: 64px;
      border-radius: 2px;
      display: flex;
      align-items: center;
      position: absolute;
      top: 0;
      left: 0;
    }
  }
}

.addMemberCheckBox .selectPerson {
  width: 18%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(221, 221, 221, 1);
  margin-left: 15px;
  box-sizing: border-box;

  .selectPersonTitle {
    height: 28px;
    line-height: 28px;
    text-align: center;
    background: rgba(241, 241, 241, 1);
    border-bottom: 1px solid rgba(221, 221, 221, 1);
    color: rgba(128, 125, 125, 1);
    font-size: 12px;
  }

  .selectPersonData {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;

    .selectPersonDataBox {
      width: 150px;
      height: 72px;
      border-radius: 2px;
      border: 1px solid rgba(222, 222, 222, 1);
      margin: 8px 0;
      display: flex;
      position: relative;

      .MemberIcon {
        height: 100%;
        width: 64px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-right: 8px;
        background: rgba(241, 241, 241, 1);

        img {
          width: 37.81px;
          height: 39.38px;
          border-radius: 50%;
        }
      }

      .MemberDetailInfo1 {
        position: relative;
        flex: 1;
        height: 100%;
        padding: 14px 0;
        overflow: hidden;

        .name {
          color: rgba(51, 51, 51, 1);
          font-size: 12px;
          height: 20px;
          line-height: 5px;
        }

        .hostName {
          color: rgba(128, 125, 125, 1);
          font-size: 12px;
          height: 20px;
          line-height: 10px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      }
    }
  }
}

.addMemberCheck .MemberIcon {
  /* height: 100%; */
  /* height: 54px; */
  height: 62px;
  width: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  // margin-right: 8px;
  background: rgba(241, 241, 241, 1);
}

.MemberIcon img {
  width: 37.81px;
  height: 39.38px;
  border-radius: 50%;
}

.MemberIcon .name {
  color: rgba(51, 51, 51, 1);
  font-size: 12px;
  height: 20px;

  line-height: 20px;
}

.MemberIcon .hostName {
  color: rgba(128, 125, 125, 1);
  font-size: 12px;
  height: 20px;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialogBody {
  padding: 3px 20px;
  height: 80%;
  overflow-y: auto;
}

.jzBtn {
  padding: 0px;
  margin-right: 5px;
  width: 20px;
  height: 20px;
  text-align: center;
  line-height: 9px;
}

.MemberDetailInfos {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;

  .name {
    color: rgba(51, 51, 51, 1);
    font-size: 12px;
    height: 20px;
    line-height: 20px;
  }

  .hostName {
    color: rgba(128, 125, 125, 1);
    font-size: 12px;
    height: 20px;
    line-height: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.deleteUser {
  position: absolute;
  width: 22px;
  height: 22px;
  display: block;
  background: url("../../../assets/img/organization/no.png") no-repeat;
  background-size: 100% 100%;
  right: 0;
  top: 0;
}

.activetext {
  color: rgba(197, 227, 255, 1);
  background: #2b5a9d;
}

.pageFlagText {
  color: #171a1d;
  font-size: 16px;
}
</style>